<%@ include file="/taglibs.jsp"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<head>
<title>北京邮电大学学生党员在线学习中心</title>
<link href="${ctx}/css/pagination.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
	function confirmDelete(){
		return confirm("确定删除吗？");
	}
</script>
</head>
<div id="nav_bar">
    <img id="nav_bar_left" src="../../../styles/nav_bar_left.png" alt=""/>
    <div id="welcome_label">欢迎您，&nbsp;<s:property value="#session.session_user.adminName" />!</div>
    <img id="nav_bar_seperator" src="../../../styles/nav_bar_seperator.png" alt=""/>
    <div id="nav_location">
        <img id="nav_bar_point" src="../../../styles/nav_bar_point.png" alt="" />
        <div id="nav_cur_location">当前位置：&nbsp;<a href="${ctx}/Admin_branchManageAction_manageBranch">党组织管理</a>&nbsp;&nbsp;>&nbsp;&nbsp;<span style="color:black;">支部公告管理</span></div>
    </div>
    <img style="float:right; width:5px;" src="../../../styles/nav_bar_right.png" alt=""/>
    <a id="nav_logout" href="${ctx}/logoutAction_adminLogout">[安全退出]</a>
</div>
<div style="clear:both; height:5px;">&nbsp;</div>

<div style="min-height:450px;">
	<div id="side_menu" style="min-height:650px;">
	    <div id="side_menu_title">
	        <img src="../../../styles/side_menu_title_img.png" alt="" />
	        <span>党组织管理</span>
	    </div>
	    <div id="side_menu_title_bottom">&nbsp;</div>
	    <div class="side_sub_menu">
	        <div class="side_menu_point">&nbsp;</div>
	        <a href="${ctx}/Admin_MyBranchAction_branchList">党组织维护</a>
	    </div>
	     <s:if test="#session.level == 2 || #session.level == 3">
	    <div class="side_menu_seperator">&nbsp;</div>
	    <div class="side_sub_menu">
	        <div class="side_menu_point">&nbsp;</div>
	        <a href="${ctx}/Admin_MyBranchAction_addBranch">新增党组织</a>
	    </div>
	    </s:if>
	    <div class="side_menu_seperator">&nbsp;</div>
	    <div class="side_sub_menu_focus">
	        <div class="side_menu_point">&nbsp;</div>
	        <a href="${ctx }/Admin_MyBranchAction_manageBranchNotice">支部公告管理</a>
	    </div>
	    <div class="side_menu_seperator">&nbsp;</div>
	    <div class="side_sub_menu">
	        <div class="side_menu_point">&nbsp;</div>
	        <a href="${ctx }/Admin_MyBranchAction_manageBranchActivity">支部活动管理</a>
	    </div>
	</div>
	
	<div id="main_content">
	    <div id="main_content_title">
	        <img src="../../../styles/content_title_img.png" alt="" />
	        <span>支部公告管理</span>
	    </div>
	    <div class="main_content_title_bottom">&nbsp;</div>

			<form  action="${ctx }/Admin_MyBranchAction_manageBranchNotice" method="post">
					<table >
							<tr>
								<td>
								请输入查询内容：
								</td>
								<td>
								<input type="text" name="titleOnQuery" size=60 value="<s:property value="titleOnQuery"/>">
								</td>
								<td style="width:60px;text-align:center;">
								<input type="submit"  name="button" id="button" class="input-button"  value="查询"/>
								</td>
								<td>
								<input id="learn" name="learn" type="button" class="input-button" value="发布新支部公告" onclick="window.location.href='Admin_MyBranchAction_newBranchNotice'"/>
								</td>	
							</tr>
						</table>
						<input type="hidden" name="pageNow" value="1"/>
						</form>
					
					<br/>
					
					<table class="list-table">
						<tr >
							<th>
								标题
							</th>
							<th >
								发布者
							</th>
							<th>
								发布时间
							</th>
							<th style="width:280px;">
								所属支部
							</th>
							<th>
								操作
							</th>
							
						</tr>
						
						<s:iterator value="branchNewsList" status="st">
						
						<tr>
							
							<td>
							     <a href="${ctx }/Admin_MyBranchAction_viewNews?id=<s:property value="id"/>" target=""  title="<s:property value="title"/>">
							      <s:if test="%{title.length()>15}">
										<s:property value="title.substring(0,15)+'...'" />
								</s:if> 
								<s:else>
										<s:property value="title" />
								</s:else> 
							     </a>
							</td>
							<td >
								<s:property value="getPosterNameByNo(posterNo)"/>
							</td>
							<td>
								<s:date name="posterTime" format="yyyy年MM月dd日"/>
							</td>
							<td style="width:280px;">
								<s:property value="getBranchNameByBranchId(branchId)"/>
							</td>
							<td >
								<s:if test="#session.session_user.adminLevel == 3 || checkBranchInCharge(branchId) == true">
								<a href="${ctx }/Admin_MyBranchAction_modifyNews?id=<s:property value="id"/>&pageNow=<s:property value="#request.modifyNewsPageNow"/>">修改</a>&nbsp;&nbsp;&nbsp;
								<a href="${ctx }/Admin_MyBranchAction_deleteNews?id=<s:property value="id"/>&pageNow=<s:property value="#request.modifyNewsPageNow"/>" onclick="return confirmDelete();">删除</a>
								</s:if>
							</td>
						</tr>
						
						</s:iterator>
						
					</table>
					
				<div style="clear:both; height:10px;"></div>

					<div style="margin-left:0; text-align: center;">
							<s:property value="paginationCode" escape="false"/>
					</div>
		</div>
		<div style="clear:both">&nbsp;</div>
</div>